1. Technical Field
The present invention relates in general to a multiprocessor data processing system, and in particular to a method, system, and program for saving a state of a task by a processor in a multiprocessor system. Still more particularly, the present invention relates to a method, system, and program for selecting and executing the task by the processor in the multiprocessor system.
2. Description of the Related Art
A data processing system may be a multiprocessor system having a plurality of processors. Each processor has a number of register sets. These register sets may be, for example, general purpose registers or floating point registers.
Generally, when a processor in a multiprocessor system finishes a last task and is switching to execute a next task, the state of the last task must be saved into a memory system by saving the states of all of the register sets and all other volatile data for the processor into the memory system. Generally, a state of a task is defined by all of the contents of the registers and all other volatile data for the processor that is executing the task. This save operation is performed for all of the register sets, including registers that may only be occasionally or rarely accessed for some tasks, such as the floating point registers. A considerable amount of overhead and processing time may be required for saving and setting the states for these registers that are only occasionally or rarely accessed by tasks of various application programs. Performing save operations for these registers in instances in which these registers are not even used is extremely wasteful of the processing time of the processor.
For example, in an Intel-based multiprocessor system, the state of the floating point registers for a running thread or task execution must be saved when a task switch is made. Similarly, in a multiprocessor system running under OS/2, save operations are performed on the floating point registers every time a task switch occurs for a processor in the multiprocessor system. Saving and restoring these floating point registers involves a considerable amount of overhead. However, most application programs do not use the floating point registers. Thus, the present invention recognizes that saving floating point registers, especially for the task switches in the applications that do not use the floating point registers, is extremely inefficient. Improvements in efficiency for saving these registers in a uni-processor system have been made, but the present invention recognizes the need to improve the efficiency for saving these registers in a multiprocessor system. In improving the efficiency of saving these registers, the present invention also recognizes the need to continually improve the efficiency of executing a task by a processor within the multiprocessor system.